<?php
namespace Admin\Model;
use Think\Model\RelationModel;
class GoodsModel extends RelationModel{
    public $_link = array(
        'comment'=>self::HAS_MANY,
    );

    public $_validate = array(
        array('goods_name','3,6','长度不够',1,'length',3),
        // array('shop_price','price','价格不能为负',1,'callback',3),
    );

    public $_auto = array(
        array('add_time','time',3,'function'),
    );

    public $insertFields = array('goods_id','cat_id','goods_sn','goods_name','goods_number','goods_weight','shop_price','goods_desc','goods_brief','ori_img','goods_img','thumb_img','is_best','is_new','is_hot','is_sale','last_update');

    // public function price(){
    //     echo $_POST['shop_price'];
    //     return false;
    //     // if(mt_rand(1,9)<5){
    //     //
    //     // }else {
    //     //     return true;
    //     // }
    // }
}
